"""main URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  url(r'^$', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""

# from components.home.menu_manage.views import MenuManage
# from components.login.views import Login
# from django.contrib import admin
from django.urls import re_path
from django.urls import path, include
from rest_framework_simplejwt.views import TokenRefreshView, TokenVerifyView

from components import urls as home_urls
from components.home.menu_manage.views import MenuManage
from components.login.views import MyTokenObtainPairView

# from components.home.ssh_client import websoso
# from components.home.ssh_client.consumers import ChatConsumer
# from components.home.ssh_client.ssh_chat import ssh_chat
from components.user_manage.views import Create_user
from api import urls as api_urls


urlpatterns = [
    # url(r'^admin/', admin.site.urls),
    re_path(r'^background/login$', MyTokenObtainPairView.as_view()),
    re_path(r'^background/create_user$', Create_user.as_view()),
    re_path(r'^background/home/menu_manage$', MenuManage.as_view()),
    # path('login/', TokenObtainPairView.as_view(), name='token_obtain_pair'),  # 登录一般是login
    path('api/token/refresh/', TokenRefreshView.as_view(), name='token_refresh'),  # 刷新simplejwt
    re_path(r'^background/token/verify$', TokenVerifyView.as_view(),name='token_verify'),
    re_path(r'^background/home/', include(home_urls)),
    re_path(r'^background/api/', include(api_urls)),
]
